﻿/*
 Enter your code here. Read input from STDIN. Print output to STDOUT
 Your class should be named Solution
*/
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;

namespace www.interviewstreet.com.MeetingPoint
{
    class Solution
    {
        static void Main(string[] args)
        {
            int noofhouses = Convert.ToInt32(Console.ReadLine());
            long minD = long.MaxValue;
            Plane p = new Plane();
            string[] tempArr = new string[2];
            while (noofhouses > 0)
            {

                tempArr = Console.ReadLine().Split(' ');
                p.AddPoint(new Point(Convert.ToInt64(tempArr[0]), Convert.ToInt64(tempArr[1])));

                noofhouses = noofhouses - 1;
            }

            foreach (var point in p.Points())
            {
                long d = 0;
                foreach (var innerPoint in p.Points())
                {
                    d = d + point.Distance(innerPoint);
                }
                if (d < minD)
                {
                    minD = d;
                }
            }

            Console.WriteLine("{0}", minD);
            Console.ReadLine();
        }





    }

    class Point
    {
        public Point(long x, long y)
        {
            this.X = x;
            this.Y = y;
        }

        public long X { get; set; }
        public long Y { get; set; }


        public long Distance(Point p)
        {

            return Math.Max(Math.Abs(p.X - this.X), Math.Abs(p.Y - this.Y));
        }
    }

    class Plane
    {
        private List<Point> _points;

        public Plane()
        {
            _points = new List<Point>();
        }

        public bool AddPoint(Point p)
        {
            _points.Add(p);
            return true;
        }

        public List<Point> Points()
        {
            return _points;
        }
    }


}